<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title><!--{$lang.page.index.title}--></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="/static/lay/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/lay/layui/index.css" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
        <form name="addItem" method="post" lay-filter="component-form-group" class="layui-form">
          <input type="hidden" value="<!--{$datainfo.id}-->" name="id">

            <div class="layui-form-item">

              <div class="layui-inline">
                <label class="layui-form-label"><!--{$lang.page.mue.ident}--></label>
                <div class="layui-input-inline" >
                   <input type="text" name="grade" lay-verify="grade" value="<!--{$datainfo.grade}-->" placeholder="<!--{$lang.page.public.pinput}-->" autocomplete="off" class="layui-input" />
                </div>
              </div>

            </div>

            <div class="layui-form-item">

            <div class="layui-form-item">
              <div class="layui-inline">
               <label class="layui-form-label"><!--{$lang.page.table.status}--></label>
               <div class="layui-input-block">
                 <input type="radio" name="status" value="0" title="<!--{$lang.page.table.close}-->" <!--{if $datainfo.status eq 0}--> checked<!--{/if}-->  >&nbsp;&nbsp;<input type="radio" name="status" value="1" title="<!--{$lang.page.table.normal}-->" <!--{if $datainfo.status eq 1}--> checked<!--{/if}-->>
               </div>
              </div>

            </div>
       
          <div class="layui-form-item layui-layout-admin">
            <div>
              <div class="layui-footer" style="left: 0;">
                <button class="layui-btn" type="button" id="submit" lay-submit lay-filter="submit"><!--{$lang.page.public.submit}--></button>
                <button type="reset" class="layui-btn layui-btn-primary"><!--{$lang.page.public.reset}--></button>
                <button type="button" class="layui-btn layui-btn-primary" onClick="xadmin.close();" ><!--{$lang.page.table.back}--></button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>

</body>
</html>

  <script src="/static/lay/layui/layui.js"></script>
  <script type="text/javascript">
    layui.config({
     base: '/static/lay/' //静态资源所在路径
   }).extend({
     xadmin: 'lib/xadmin' //弹窗
   }).use(['jquery', 'layer', 'xadmin', 'form'], function(){
    var $ = layui.$;
    var form = layui.form;
     form.render(null, 'component-form-group');

     /* 自定义验证规则 */
    form.verify({
      grade: function(value){
        if(value.length < 1){
          return '<!--{$lang.page.public.pinput}--> <!--{$lang.page.mue.ident}-->';
        }
      }
      
    });
     
    form.on('submit(submit)', function (data) {
        $('#submit').attr("disabled",true);
        $('#submit').addClass('layui-btn-disabled');
        $.post('',data.field,function(res){
            if(res.code == 200){
                layer.msg(res.msg);
                setTimeout(() => {
                  window.parent.location.reload();
                  xadmin.close();
                }, 1000); 
            }else{
                layer.msg(res.msg);
            }
        })
        return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });

  });

  </script>